class A{
    private int num;

    public void setNum(int num) {
        this.num = num;
    }

    public int getNum(){
       return this.num;
    }
}

class B{
    private int num;

    public void setNum(int num){
        this.num = num;
    }

    public int getNum(){
        return this.num;
    }
}

public class demo2 {
    public static void fun(A a,B b){
        int temp = a.getNum();
        a.setNum(b.getNum());
        b.setNum(temp);
    }

    public static void main(String[] args) {
        A a= new A();
        a.setNum(10);
        B b = new B();
        b.setNum(20);
        System.out.println("a==="+a.getNum());
        System.out.println("b==="+b.getNum());
        System.out.println("==============");
        fun(a,b);
        System.out.println("a==="+a.getNum());
        System.out.println("b==="+b.getNum());
    }
}
